package cn.bluemobi.platform.service.impl;

import org.apache.commons.lang.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import cn.bluemobi.common.core.dto.MapDto;
import cn.bluemobi.platform.entity.system.SystemSetting;
import cn.bluemobi.platform.entity.system.User;
import cn.bluemobi.platform.mapper.SystemSettingMapper;
import cn.bluemobi.platform.service.SystemSettingService;

/**
 * 
 * @author lvxh
 * 
 */
@Service
@Transactional
public class SystemSettingServiceImpl implements SystemSettingService {

	@Autowired
	private SystemSettingMapper systemSettingMapper;

	@Override
	public MapDto saveOrUpdate(SystemSetting systemSetting, User user) {
		MapDto dto = new MapDto();
		if (StringUtils.isEmpty(systemSetting.getSystemSettingId())) {
			// 新增
			systemSettingMapper.insertSystemSetting(systemSetting);
		} else {
			// 编辑
			systemSettingMapper.updateSystemSetting(systemSetting);
		}
		return dto;
	}

	@Override
	public SystemSetting findSystemSettingDetail() {
		return systemSettingMapper.findSystemSettingDetail();
	}

}
